/**
 */
package gatperdut.chato.model.Chato.Craft.impl;

import gatperdut.chato.model.Chato.Constant.CraftCategory;

import gatperdut.chato.model.Chato.Craft.Craft;
import gatperdut.chato.model.Chato.Craft.CraftPackage;
import gatperdut.chato.model.Chato.Craft.CraftStep;
import gatperdut.chato.model.Chato.Craft.CraftTool;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.util.InternalEList;

import org.eclipse.emf.internal.cdo.CDOObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Craft</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.CraftImpl#getCommand <em>Command</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.CraftImpl#getInitMessageSelf <em>Init Message Self</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.CraftImpl#getInitMessageOthers <em>Init Message Others</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.CraftImpl#getSuccessMessageSelf <em>Success Message Self</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.CraftImpl#getSuccessMessageOthers <em>Success Message Others</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.CraftImpl#getSteps <em>Steps</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.CraftImpl#getTools <em>Tools</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.CraftImpl#getCategories <em>Categories</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.CraftImpl#getTime <em>Time</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class CraftImpl extends CDOObjectImpl implements Craft {
	/**
     * The default value of the '{@link #getCommand() <em>Command</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getCommand()
     * @generated
     * @ordered
     */
	protected static final String COMMAND_EDEFAULT = null;

	/**
     * The default value of the '{@link #getInitMessageSelf() <em>Init Message Self</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getInitMessageSelf()
     * @generated
     * @ordered
     */
	protected static final String INIT_MESSAGE_SELF_EDEFAULT = null;

	/**
     * The default value of the '{@link #getInitMessageOthers() <em>Init Message Others</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getInitMessageOthers()
     * @generated
     * @ordered
     */
	protected static final String INIT_MESSAGE_OTHERS_EDEFAULT = null;

	/**
     * The default value of the '{@link #getSuccessMessageSelf() <em>Success Message Self</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getSuccessMessageSelf()
     * @generated
     * @ordered
     */
	protected static final String SUCCESS_MESSAGE_SELF_EDEFAULT = null;

	/**
     * The default value of the '{@link #getSuccessMessageOthers() <em>Success Message Others</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getSuccessMessageOthers()
     * @generated
     * @ordered
     */
	protected static final String SUCCESS_MESSAGE_OTHERS_EDEFAULT = null;

	/**
     * The default value of the '{@link #getTime() <em>Time</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getTime()
     * @generated
     * @ordered
     */
	protected static final int TIME_EDEFAULT = 0;

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	protected CraftImpl() {
        super();
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected EClass eStaticClass() {
        return CraftPackage.Literals.CRAFT;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected int eStaticFeatureCount() {
        return 0;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public String getCommand() {
        return (String)eDynamicGet(CraftPackage.CRAFT__COMMAND, CraftPackage.Literals.CRAFT__COMMAND, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setCommand(String newCommand) {
        eDynamicSet(CraftPackage.CRAFT__COMMAND, CraftPackage.Literals.CRAFT__COMMAND, newCommand);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public String getInitMessageSelf() {
        return (String)eDynamicGet(CraftPackage.CRAFT__INIT_MESSAGE_SELF, CraftPackage.Literals.CRAFT__INIT_MESSAGE_SELF, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setInitMessageSelf(String newInitMessageSelf) {
        eDynamicSet(CraftPackage.CRAFT__INIT_MESSAGE_SELF, CraftPackage.Literals.CRAFT__INIT_MESSAGE_SELF, newInitMessageSelf);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public String getInitMessageOthers() {
        return (String)eDynamicGet(CraftPackage.CRAFT__INIT_MESSAGE_OTHERS, CraftPackage.Literals.CRAFT__INIT_MESSAGE_OTHERS, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setInitMessageOthers(String newInitMessageOthers) {
        eDynamicSet(CraftPackage.CRAFT__INIT_MESSAGE_OTHERS, CraftPackage.Literals.CRAFT__INIT_MESSAGE_OTHERS, newInitMessageOthers);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public String getSuccessMessageSelf() {
        return (String)eDynamicGet(CraftPackage.CRAFT__SUCCESS_MESSAGE_SELF, CraftPackage.Literals.CRAFT__SUCCESS_MESSAGE_SELF, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setSuccessMessageSelf(String newSuccessMessageSelf) {
        eDynamicSet(CraftPackage.CRAFT__SUCCESS_MESSAGE_SELF, CraftPackage.Literals.CRAFT__SUCCESS_MESSAGE_SELF, newSuccessMessageSelf);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public String getSuccessMessageOthers() {
        return (String)eDynamicGet(CraftPackage.CRAFT__SUCCESS_MESSAGE_OTHERS, CraftPackage.Literals.CRAFT__SUCCESS_MESSAGE_OTHERS, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setSuccessMessageOthers(String newSuccessMessageOthers) {
        eDynamicSet(CraftPackage.CRAFT__SUCCESS_MESSAGE_OTHERS, CraftPackage.Literals.CRAFT__SUCCESS_MESSAGE_OTHERS, newSuccessMessageOthers);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@SuppressWarnings("unchecked")
	public EList<CraftStep> getSteps() {
        return (EList<CraftStep>)eDynamicGet(CraftPackage.CRAFT__STEPS, CraftPackage.Literals.CRAFT__STEPS, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@SuppressWarnings("unchecked")
	public EList<CraftTool> getTools() {
        return (EList<CraftTool>)eDynamicGet(CraftPackage.CRAFT__TOOLS, CraftPackage.Literals.CRAFT__TOOLS, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@SuppressWarnings("unchecked")
	public EList<CraftCategory> getCategories() {
        return (EList<CraftCategory>)eDynamicGet(CraftPackage.CRAFT__CATEGORIES, CraftPackage.Literals.CRAFT__CATEGORIES, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public int getTime() {
        return (Integer)eDynamicGet(CraftPackage.CRAFT__TIME, CraftPackage.Literals.CRAFT__TIME, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setTime(int newTime) {
        eDynamicSet(CraftPackage.CRAFT__TIME, CraftPackage.Literals.CRAFT__TIME, newTime);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case CraftPackage.CRAFT__STEPS:
                return ((InternalEList<?>)getSteps()).basicRemove(otherEnd, msgs);
            case CraftPackage.CRAFT__TOOLS:
                return ((InternalEList<?>)getTools()).basicRemove(otherEnd, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case CraftPackage.CRAFT__COMMAND:
                return getCommand();
            case CraftPackage.CRAFT__INIT_MESSAGE_SELF:
                return getInitMessageSelf();
            case CraftPackage.CRAFT__INIT_MESSAGE_OTHERS:
                return getInitMessageOthers();
            case CraftPackage.CRAFT__SUCCESS_MESSAGE_SELF:
                return getSuccessMessageSelf();
            case CraftPackage.CRAFT__SUCCESS_MESSAGE_OTHERS:
                return getSuccessMessageOthers();
            case CraftPackage.CRAFT__STEPS:
                return getSteps();
            case CraftPackage.CRAFT__TOOLS:
                return getTools();
            case CraftPackage.CRAFT__CATEGORIES:
                return getCategories();
            case CraftPackage.CRAFT__TIME:
                return getTime();
        }
        return super.eGet(featureID, resolve, coreType);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case CraftPackage.CRAFT__COMMAND:
                setCommand((String)newValue);
                return;
            case CraftPackage.CRAFT__INIT_MESSAGE_SELF:
                setInitMessageSelf((String)newValue);
                return;
            case CraftPackage.CRAFT__INIT_MESSAGE_OTHERS:
                setInitMessageOthers((String)newValue);
                return;
            case CraftPackage.CRAFT__SUCCESS_MESSAGE_SELF:
                setSuccessMessageSelf((String)newValue);
                return;
            case CraftPackage.CRAFT__SUCCESS_MESSAGE_OTHERS:
                setSuccessMessageOthers((String)newValue);
                return;
            case CraftPackage.CRAFT__STEPS:
                getSteps().clear();
                getSteps().addAll((Collection<? extends CraftStep>)newValue);
                return;
            case CraftPackage.CRAFT__TOOLS:
                getTools().clear();
                getTools().addAll((Collection<? extends CraftTool>)newValue);
                return;
            case CraftPackage.CRAFT__CATEGORIES:
                getCategories().clear();
                getCategories().addAll((Collection<? extends CraftCategory>)newValue);
                return;
            case CraftPackage.CRAFT__TIME:
                setTime((Integer)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eUnset(int featureID) {
        switch (featureID) {
            case CraftPackage.CRAFT__COMMAND:
                setCommand(COMMAND_EDEFAULT);
                return;
            case CraftPackage.CRAFT__INIT_MESSAGE_SELF:
                setInitMessageSelf(INIT_MESSAGE_SELF_EDEFAULT);
                return;
            case CraftPackage.CRAFT__INIT_MESSAGE_OTHERS:
                setInitMessageOthers(INIT_MESSAGE_OTHERS_EDEFAULT);
                return;
            case CraftPackage.CRAFT__SUCCESS_MESSAGE_SELF:
                setSuccessMessageSelf(SUCCESS_MESSAGE_SELF_EDEFAULT);
                return;
            case CraftPackage.CRAFT__SUCCESS_MESSAGE_OTHERS:
                setSuccessMessageOthers(SUCCESS_MESSAGE_OTHERS_EDEFAULT);
                return;
            case CraftPackage.CRAFT__STEPS:
                getSteps().clear();
                return;
            case CraftPackage.CRAFT__TOOLS:
                getTools().clear();
                return;
            case CraftPackage.CRAFT__CATEGORIES:
                getCategories().clear();
                return;
            case CraftPackage.CRAFT__TIME:
                setTime(TIME_EDEFAULT);
                return;
        }
        super.eUnset(featureID);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public boolean eIsSet(int featureID) {
        switch (featureID) {
            case CraftPackage.CRAFT__COMMAND:
                return COMMAND_EDEFAULT == null ? getCommand() != null : !COMMAND_EDEFAULT.equals(getCommand());
            case CraftPackage.CRAFT__INIT_MESSAGE_SELF:
                return INIT_MESSAGE_SELF_EDEFAULT == null ? getInitMessageSelf() != null : !INIT_MESSAGE_SELF_EDEFAULT.equals(getInitMessageSelf());
            case CraftPackage.CRAFT__INIT_MESSAGE_OTHERS:
                return INIT_MESSAGE_OTHERS_EDEFAULT == null ? getInitMessageOthers() != null : !INIT_MESSAGE_OTHERS_EDEFAULT.equals(getInitMessageOthers());
            case CraftPackage.CRAFT__SUCCESS_MESSAGE_SELF:
                return SUCCESS_MESSAGE_SELF_EDEFAULT == null ? getSuccessMessageSelf() != null : !SUCCESS_MESSAGE_SELF_EDEFAULT.equals(getSuccessMessageSelf());
            case CraftPackage.CRAFT__SUCCESS_MESSAGE_OTHERS:
                return SUCCESS_MESSAGE_OTHERS_EDEFAULT == null ? getSuccessMessageOthers() != null : !SUCCESS_MESSAGE_OTHERS_EDEFAULT.equals(getSuccessMessageOthers());
            case CraftPackage.CRAFT__STEPS:
                return !getSteps().isEmpty();
            case CraftPackage.CRAFT__TOOLS:
                return !getTools().isEmpty();
            case CraftPackage.CRAFT__CATEGORIES:
                return !getCategories().isEmpty();
            case CraftPackage.CRAFT__TIME:
                return getTime() != TIME_EDEFAULT;
        }
        return super.eIsSet(featureID);
    }

} //CraftImpl
